<!DOCTYPE html>
<html lang="en">
<head>
    {% load static %} {#允许在模版中引入静态资源 #}
    <meta charset="UTF-8">
    <title>{{ title }}</title>
    <link rel="stylesheet" type="text/css" href="{%  static 'css/main.css' %}">
    <link rel="stylesheet" type="text/css" href="{% static 'layui/css/layui.css' %}">
    <script type="text/javascript" src="{% static 'layui/layui.js' %}"></script>
</head>
<body>
    <div class="header">
        <div class="headerLayout w1200">
            <div class="headerCon">
                <h1 class="mallLogo">
                    {# 第一个index代表mybabys文件中的urls.py中定义的路由命名空间namespace #}
                    <a href="{% url 'index:index' %}" title="母音商城">
                    <img src="{%  static 'img/logo.png' %}">
                    </a>
                </h1>
                <div class="mallSearch">
                    <form action="{% url 'commodity:commodity'%}" method="get" class="layui-form" novalidate>
                        <input type="text" name="n" required lay-verify="required" autocomplete="off"
                               class="layui-input" placeholder="请输入需要的商品">
                        <button class="layui-bin" lay-submit lay-filter="formDemo">
                            <i class="layui-icon layui-icon-search"></i>
                        </button>
                    </form>
                </div>
            </div>
        </div>
    </div>

    {# 导航栏 #}
    <div class="content content-nav-base {{ classContent }}">
        <div class="main-nav">
            <div class="inner-cont0">
                <div class="inner-cont1 w1200">
                    <div class="inner-cont2">
                        <a href="{%  url 'index:index' %}" {%  if classContent == '' %}class="active"{%  endif  %}>
                            首页
                        </a>
                    <a href="{%  url 'commodity:commodity' %}" {%  if classContent == '' %}class="active"{%  endif  %}>
                            所有商品
                        </a>
                    <a href="{%  url 'shopper:shopcart' %}" {%  if classContent == '' %}class="active"{%  endif  %}>
                            购物车
                        </a>
                    <a href="{%  url 'shopper:shopper' %}" {%  if classContent == '' %}class="active"{%  endif  %}>
                            个人中心
                        </a>
                    </div>
                </div>
            </div>
        </div>

        {#用Django内置模版语法block设置文件调用入口,三个调用接口content、footer、script#}
    {% block content %} {% endblock %} {# 内容 #}
    </div>
    {% block footer %} {% endblock footer %} {# 页脚 #}
<script type="text/javascript">
    {% block script %} {%  endblock script %} {# 脚本 #}
</script>

</body>
</html>